<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<title>授权一览</title>
<head th:replace="system/inc/incHead :: incHead"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content no-padding">
	<form id="pagerForm" action="/sys/auth" method="get">
		<input type="hidden" id="pageNum" name="pageNum" value="1"/>
		<input type="hidden" name="numPerPage" th:value="${page.numPerPage}"/>
		<input type="hidden" name="orderField" th:value="${orderField}"/>
		<input type="hidden" name="orderDirection" th:value="${orderDirection}"/>
		<div class="ibox no-margins no-padding no-borders">
			<div class="ibox-title no-margins no-padding no-borders">
				<div class="row p-xs ljRowSearch">
					<div class="form-group col-md-3">
						<div class="input-group m-l-sm">
							<span class="input-group-addon">时间间隔:</span>
							<input th:placeholder="${ts}" class="form-control layer-date input-sm" id="ts" name="ts" th:value="${ts}">
							<span class="input-group-addon">到</span>
							<input th:placeholder="${te}" class="form-control layer-date input-sm" id="te" name="te" th:value="${te}">
						</div>
					</div>
					<div class="form-group col-md-3">
						<div class="input-group m-l-sm">
							<span class="input-group-addon">授权ID:</span>
							<input name="authId" type="text" class="form-control input-sm" th:value="${authId}">
						</div>
					</div>
					<div class="form-group col-md-3">
						<div class="input-group m-l-sm">
							<span class="input-group-addon">授权用户:</span>
							<input name="authDesc" type="text" class="form-control input-sm" th:value="${authDesc}">
						</div>
					</div>
					<div class="form-group col-md-3">
						<div class="input-group m-l-sm">
							<span class="input-group-addon">数据状态:</span>
							<select name="dataStatus" data-placeholder="请选择数据状态..." class="chosen-select"
									style="width:100%;">
								<option value="">请选择数据状态</option>
								<option value="0" hassubinfo="true" th:selected="${dataStatus == '0'}" }>启用</option>
								<option value="1" hassubinfo="true" th:selected="${dataStatus == '1'}" }>禁用</option>
							</select>
						</div>
					</div>
				</div>
			</div>
		</div>
	</form>
	<div class="ibox no-margins">
		<div class="ibox-title">
			<button th:if="${@lj.limit('SysAuthAdd')>0}" class="btn btn-sm btn-info" ljUrl="/sys/auth/add" title="添加授权" target="ljOpenCon">
				<i class="fa fa-paste">添加授权</i>
			</button>
			<button th:if="${@lj.limit('SysAuthImport')>0}" class="btn btn-sm btn-primary" ljUrl="/sys/auth/import" title="批量导入"
					target="ljOpenCon" ljWidth="600px" ljHeight="300px">
				<i class="fa fa-paste">批量导入</i>
			</button>
			<a th:if="${@lj.limit('SysAuthExcel')>0}" class="btn btn-sm btn-primary" href="/sys/auth/excel" title="批量导出">
				<i class="fa fa-paste">批量导出</i>
			</a>
			<button class="btn btn-success btn-sm pull-right btnPagerForm" type="button"><i class="fa fa-search">重新检索</i></button>
		</div>
		<div class="ibox-content p-xs ljScrollbar3" style="overflow:auto;" layoutH="145">
			<table id="listTable" class="table table-striped table-bordered table-hover table-responsive lj-table-nowrap no-margins">
				<thead>
				<tr>
					<th style="min-width:60px;">编号</th>
					<th style="min-width:80px;">授权方式</th>
					<th style="min-width:100px;">授权ID</th>
					<th style="min-width:280px;">授权值</th>
					<th style="min-width:280px;">授权用户</th>
					<th style="min-width:140px;">授权时间</th>
					<th style="min-width:100px;">授权有效期(D)</th>
					<th style="min-width:200px;">操作</th>
				</tr>
				</thead>
				<tbody>
				<tr th:each="item:${records}" class="warning">
					<td style="min-width:60px;">[[${item.id}]]</td>
					<td style="min-width:80px;">[[${item.authType}]]</td>
					<td style="min-width:100px;">[[${item.authId}]]</td>
					<td th:if="${session.admin_login.id==0}" style="min-width: 280px;">[[${item.authValue}]]</td>
					<td th:if="${session.admin_login.id!=0}" style="min-width: 280px;">[[${@lj.indistinct2(item.authValue,4,4)}]]</td>
					<td style="min-width:280px;">[[${item.authDesc}]]</td>
					<td style="min-width:140px;">[[${@lj.date(item.authTime)}]]</td>
					<td style="min-width:100px;">[[${item.authAvailable}]]</td>
					<td style="min-width:200px;">
						<div th:if="${@lj.limit('SysAuthEdit')>0}" class="btn btn-xs btn-info" th:ljUrl="|/sys/auth/edit?id=${item.id}|"
							 title="授权编辑" target="ljOpenCon">
							<i class="fa fa-paste">授权编辑</i>
						</div>
						<div th:if="${@lj.limit('SysAuthDetail')>0}" class="btn btn-xs btn-primary" th:ljUrl="|/sys/auth/detail?id=${item.id}|"
							 title="授权详情" target="ljOpenCon">
							<i class="fa fa-paste">授权详情</i>
						</div>
						<div th:if="${@lj.limit('SysAuthDel')>0}" class="btn btn-xs btn-danger" th:ljUrl="|/sys/auth/del?id=${item.id}|"
							 title="确认要删除该授权吗?"
							 target="ljAjaxTodo">
							<i class="fa fa-minus-circle">删除授权</i>
						</div>
					</td>
				</tr>
				</tbody>
			</table>
		</div>
	</div>
</div>
<div th:replace="system/inc/incBottom :: incBottom"></div>
<div th:replace="system/inc/incPage :: incPage"></div>
<script>
	jQuery(function ($) {
		$(".chosen-select").chosen();
	});
</script>
</body>
</html>
